package com.zztl.infiniteBand.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.zztl.infiniteBand.R
import com.zztl.infiniteBand.model.BindedDeviceBean
import com.zztl.infiniteBand.util.DateUtils
import com.zztl.infiniteBand.util.device.DeviceUtil
import java.util.*

/**
 * @desc
 * @auth ${user}
 * @time 2018/9/27  10:15
 */
class BindedDeviceAdapter(layoutResId: Int, data: List<BindedDeviceBean.DataBean.RowsBean>) : BaseQuickAdapter<BindedDeviceBean.DataBean.RowsBean, BaseViewHolder>(layoutResId, data) {
    override fun convert(helper: BaseViewHolder?, item: BindedDeviceBean.DataBean.RowsBean?) {
        helper!!.setText(R.id.tv_name, DeviceUtil.DEVICE_NAME)
        helper!!.setText(R.id.tv_mac, item!!.mac)
        helper!!.setText(R.id.tv_bind_time, DateUtils.formatTime(Date(item!!.createTime)))
    }
}
